{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/pages/Home/Profile/index.tsx\",\n  _s = $RefreshSig$();\nimport React from 'react';\nimport { Home } from \"../../\";\nimport { Circle } from 'rc-progress';\nimport { observer } from \"mobx-react-lite\";\nimport { Context } from \"../../../index\";\nimport { profileCompletionPercentage } from \"../../../utils/User\";\nimport LoadingButton from '@mui/lab/LoadingButton';\nimport Box from '@mui/material/Box';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Switch from '@mui/material/Switch';\nimport SaveIcon from '@mui/icons-material/Save';\nimport SendIcon from '@mui/icons-material/Send';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Profile = () => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const [profilePercent, setProfilePercent] = React.useState(0);\n  const [loading, setLoading] = React.useState(true);\n  function handleClick() {\n    setLoading(true);\n  }\n  const memoizedProfile = React.useMemo(() => profileCompletionPercentage(store.getProfile()), [store.getProfile()]);\n  React.useEffect(() => {\n    setProfilePercent(memoizedProfile);\n  }, [store.getProfile()]);\n  return /*#__PURE__*/_jsxDEV(Home, {\n    childrenFirst: /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"messenger__sidebar-item\",\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-item-header\",\n        children: /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"messenger__sidebar-item-header-top\",\n          children: /*#__PURE__*/_jsxDEV(\"span\", {\n            children: \"\\u041D\\u0430\\u0441\\u0442\\u0440\\u043E\\u0439\\u043A\\u0438 \\u043F\\u0440\\u043E\\u0444\\u0438\\u043B\\u044F\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 37,\n            columnNumber: 29\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 36,\n          columnNumber: 25\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 35,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-profile\",\n        children: [/*#__PURE__*/_jsxDEV(Circle, {\n          percent: profilePercent,\n          strokeWidth: 3,\n          className: \"messenger__sidebar-profile-progress\"\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 41,\n          columnNumber: 25\n        }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n          className: \"messenger__sidebar-profile-progressInfo\",\n          children: [\"\\u041F\\u0440\\u043E\\u0444\\u0438\\u043B\\u044C \\u0437\\u0430\\u043F\\u043E\\u043B\\u043D\\u0435\\u043D \\u043D\\u0430: \", profilePercent.toString().slice(0, 5), \"%\"]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 46,\n          columnNumber: 25\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 40,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-profileControl\",\n        children: /*#__PURE__*/_jsxDEV(Box, {\n          children: [/*#__PURE__*/_jsxDEV(FormControlLabel, {\n            sx: {\n              display: 'block'\n            },\n            control: /*#__PURE__*/_jsxDEV(Switch, {\n              checked: loading,\n              onChange: () => setLoading(!loading),\n              name: \"loading\",\n              color: \"primary\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 57,\n              columnNumber: 37\n            }, this),\n            label: \"Loading\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 52,\n            columnNumber: 29\n          }, this), /*#__PURE__*/_jsxDEV(Box, {\n            sx: {\n              '& > button': {\n                m: 1\n              }\n            },\n            children: [/*#__PURE__*/_jsxDEV(LoadingButton, {\n              size: \"small\",\n              onClick: handleClick,\n              loading: loading,\n              variant: \"outlined\",\n              disabled: true,\n              children: \"disabled\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 67,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(LoadingButton, {\n              size: \"small\",\n              onClick: handleClick,\n              loading: loading,\n              loadingIndicator: \"Loading\\u2026\",\n              variant: \"outlined\",\n              children: \"Fetch data\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 76,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(LoadingButton, {\n              size: \"small\",\n              onClick: handleClick,\n              endIcon: /*#__PURE__*/_jsxDEV(SendIcon, {}, void 0, false, {\n                fileName: _jsxFileName,\n                lineNumber: 88,\n                columnNumber: 46\n              }, this),\n              loading: loading,\n              loadingPosition: \"end\",\n              variant: \"contained\",\n              children: \"Send\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 85,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(LoadingButton, {\n              size: \"small\",\n              color: \"secondary\",\n              onClick: handleClick,\n              loading: loading,\n              loadingPosition: \"start\",\n              startIcon: /*#__PURE__*/_jsxDEV(SaveIcon, {}, void 0, false, {\n                fileName: _jsxFileName,\n                lineNumber: 101,\n                columnNumber: 48\n              }, this),\n              variant: \"contained\",\n              children: \"Save\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 95,\n              columnNumber: 33\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 66,\n            columnNumber: 29\n          }, this), /*#__PURE__*/_jsxDEV(Box, {\n            sx: {\n              '& > button': {\n                m: 1\n              }\n            },\n            children: [/*#__PURE__*/_jsxDEV(LoadingButton, {\n              onClick: handleClick,\n              loading: loading,\n              loadingIndicator: \"Loading\\u2026\",\n              variant: \"outlined\",\n              children: \"Fetch data\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 109,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(LoadingButton, {\n              onClick: handleClick,\n              loading: loading,\n              loadingIndicator: \"Loading\\u2026\",\n              variant: \"outlined\",\n              children: \"Fetch data\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 117,\n              columnNumber: 33\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 108,\n            columnNumber: 29\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 51,\n          columnNumber: 25\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 50,\n        columnNumber: 21\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 34,\n      columnNumber: 17\n    }, this)\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 32,\n    columnNumber: 9\n  }, this);\n};\n_s(Profile, \"aZfTUL3WTi5YwKaoNyB5C3HKCW8=\");\n_c = Profile;\nexport default _c2 = observer(Profile);\nvar _c, _c2;\n$RefreshReg$(_c, \"Profile\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Home","Circle","observer","Context","profileCompletionPercentage","LoadingButton","Box","FormControlLabel","Switch","SaveIcon","SendIcon","Profile","store","useContext","profilePercent","setProfilePercent","useState","loading","setLoading","handleClick","memoizedProfile","useMemo","getProfile","useEffect","toString","slice","display","m"],"sources":["/data/messenger.client/src/pages/Home/Profile/index.tsx"],"sourcesContent":["import React from 'react';\nimport {Home} from \"../../\";\nimport  {Circle} from 'rc-progress';\nimport {observer} from \"mobx-react-lite\";\nimport {Context} from \"../../../index\";\nimport {profileCompletionPercentage} from \"../../../utils/User\";\nimport LoadingButton from '@mui/lab/LoadingButton';\nimport Box from '@mui/material/Box';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Switch from '@mui/material/Switch';\nimport SaveIcon from '@mui/icons-material/Save';\nimport SendIcon from '@mui/icons-material/Send';\n\nconst Profile = () => {\n    const {store} = React.useContext(Context);\n    const [profilePercent, setProfilePercent] = React.useState<number>(0);\n    const [loading, setLoading] = React.useState(true);\n    function handleClick() {\n        setLoading(true);\n    }\n\n    const memoizedProfile = React.useMemo(\n        () => profileCompletionPercentage(store.getProfile()),\n        [store.getProfile()]\n    );\n\n    React.useEffect(() => {\n        setProfilePercent(memoizedProfile);\n    },[store.getProfile()]);\n\n    return (\n        <Home\n            childrenFirst={\n                <div className=\"messenger__sidebar-item\">\n                    <div className=\"messenger__sidebar-item-header\">\n                        <div className=\"messenger__sidebar-item-header-top\">\n                            <span>Настройки профиля</span>\n                        </div>\n                    </div>\n                    <div className=\"messenger__sidebar-profile\">\n                        <Circle\n                            percent={profilePercent}\n                            strokeWidth={3}\n                            className=\"messenger__sidebar-profile-progress\"\n                        />\n                        <p className=\"messenger__sidebar-profile-progressInfo\">\n                            Профиль заполнен на: {profilePercent.toString().slice(0, 5)}%\n                        </p>\n                    </div>\n                    <div className=\"messenger__sidebar-profileControl\">\n                        <Box>\n                            <FormControlLabel\n                                sx={{\n                                    display: 'block',\n                                }}\n                                control={\n                                    <Switch\n                                        checked={loading}\n                                        onChange={() => setLoading(!loading)}\n                                        name=\"loading\"\n                                        color=\"primary\"\n                                    />\n                                }\n                                label=\"Loading\"\n                            />\n                            <Box sx={{ '& > button': { m: 1 } }}>\n                                <LoadingButton\n                                    size=\"small\"\n                                    onClick={handleClick}\n                                    loading={loading}\n                                    variant=\"outlined\"\n                                    disabled\n                                >\n                                    disabled\n                                </LoadingButton>\n                                <LoadingButton\n                                    size=\"small\"\n                                    onClick={handleClick}\n                                    loading={loading}\n                                    loadingIndicator=\"Loading…\"\n                                    variant=\"outlined\"\n                                >\n                                    Fetch data\n                                </LoadingButton>\n                                <LoadingButton\n                                    size=\"small\"\n                                    onClick={handleClick}\n                                    endIcon={<SendIcon />}\n                                    loading={loading}\n                                    loadingPosition=\"end\"\n                                    variant=\"contained\"\n                                >\n                                    Send\n                                </LoadingButton>\n                                <LoadingButton\n                                    size=\"small\"\n                                    color=\"secondary\"\n                                    onClick={handleClick}\n                                    loading={loading}\n                                    loadingPosition=\"start\"\n                                    startIcon={<SaveIcon />}\n                                    variant=\"contained\"\n                                >\n                                    Save\n                                </LoadingButton>\n                            </Box>\n\n                            <Box sx={{ '& > button': { m: 1 } }}>\n                                <LoadingButton\n                                    onClick={handleClick}\n                                    loading={loading}\n                                    loadingIndicator=\"Loading…\"\n                                    variant=\"outlined\"\n                                >\n                                    Fetch data\n                                </LoadingButton>\n                                <LoadingButton\n                                    onClick={handleClick}\n                                    loading={loading}\n                                    loadingIndicator=\"Loading…\"\n                                    variant=\"outlined\"\n                                >\n                                    Fetch data\n                                </LoadingButton>\n                            </Box>\n                        </Box>\n                    </div>\n                </div>\n            }\n        />\n    );\n}\n\nexport default observer(Profile);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,QAAO,QAAQ;AAC3B,SAASC,MAAM,QAAO,aAAa;AACnC,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,OAAO,QAAO,gBAAgB;AACtC,SAAQC,2BAA2B,QAAO,qBAAqB;AAC/D,OAAOC,aAAa,MAAM,wBAAwB;AAClD,OAAOC,GAAG,MAAM,mBAAmB;AACnC,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,OAAOC,MAAM,MAAM,sBAAsB;AACzC,OAAOC,QAAQ,MAAM,0BAA0B;AAC/C,OAAOC,QAAQ,MAAM,0BAA0B;AAAC;AAEhD,MAAMC,OAAO,GAAG,MAAM;EAAA;EAClB,MAAM;IAACC;EAAK,CAAC,GAAGb,KAAK,CAACc,UAAU,CAACV,OAAO,CAAC;EACzC,MAAM,CAACW,cAAc,EAAEC,iBAAiB,CAAC,GAAGhB,KAAK,CAACiB,QAAQ,CAAS,CAAC,CAAC;EACrE,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGnB,KAAK,CAACiB,QAAQ,CAAC,IAAI,CAAC;EAClD,SAASG,WAAW,GAAG;IACnBD,UAAU,CAAC,IAAI,CAAC;EACpB;EAEA,MAAME,eAAe,GAAGrB,KAAK,CAACsB,OAAO,CACjC,MAAMjB,2BAA2B,CAACQ,KAAK,CAACU,UAAU,EAAE,C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